<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="template/template.xhtml">
	<ui:define name="content">
		<h:form id="companySpying" styleClass="horizontal_full">
			<p:breadCrumb>
				<p:menuitem value="Company Reports" url="companyReports.xhtml#" />
				<p:menuitem value="Company Reports" url="companyReports.xhtml" />
				<p:menuitem value="Spying Reports" url="" />
			</p:breadCrumb>
			<h1>
				<h:outputText value="#{reportMBean.spyHeader}" />
			</h1>
			
			<p>
				On this page you see the results of your spying report. You can see the decisions of your chosen 
				competitor.
			</p>

			<p:dataTable id="spyingCompDecTable" var="compDecs"
				value="#{reportMBean.spyingCompDecData}"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}"
				rowsPerPageTemplate="10,25,50,100" paginator="true" rows="10">
				<f:facet name="header">
					<h:outputText value="Company Decisions" />
				</f:facet>
				<f:facet name="{Exporters}">
					<h:commandLink>
						<p:graphicImage library="img" name="excel.png" width="24" />
						<p:dataExporter type="xls" target="spyingCompDecTable"
							fileName="spyingCompDecTable"/>
					</h:commandLink>
					<h:commandLink>
						<p:graphicImage library="img" name="pdf.png" width="24" />
						<p:dataExporter type="pdf" target="spyingCompDecTable"
							fileName="spyingCompDecTable"/>
					</h:commandLink>
				</f:facet>

				<p:columns value="#{reportMBean.spyingCompDecColumns}" var="column"
					sortBy="#{compDecs[column.property]}" headerText="#{column.header}">
					<h:outputText value="#{compDecs[column.property]}" />
				</p:columns>
			</p:dataTable>

			<br></br>

			<p:dataTable id="spyingCompProdTable" var="compProds"
				value="#{reportMBean.spyingCompProdData}"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}"
				rowsPerPageTemplate="10,25,50,100" paginator="true" rows="10">
				<f:facet name="header">
					<h:outputText value="Company Products" />
				</f:facet>
				<f:facet name="{Exporters}">
					<h:commandLink>
						<p:graphicImage library="img" name="excel.png" width="24" />
						<p:dataExporter type="xls" target="spyingCompProdTable"
							fileName="spyingCompProdTable"/>
					</h:commandLink>
					<h:commandLink>
						<p:graphicImage library="img" name="pdf.png" width="24" />
						<p:dataExporter type="pdf" target="spyingCompProdTable"
							fileName="spyingCompProdTable"/>
					</h:commandLink>
				</f:facet>

				<p:columns value="#{reportMBean.spyingCompProdColumns}"
					var="columnCompProd" sortBy="#{compProds[columnCompProd.property]}" 
					headerText="#{columnCompProd.header}">
					<h:outputText value="#{compProds[columnCompProd.property]}" />
				</p:columns>
			</p:dataTable>

		</h:form>

	</ui:define>
</ui:composition>

</html>